package consumer;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.dubbo.annotation.EnableDubbo;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;

@EnableDubbo
@SpringBootApplication
@ComponentScan("consumer")
public class ConsumerApplication implements InitializingBean {

	@Autowired
	private EchoService echoService;

	public static void main(String[] args) throws Exception {
		new SpringApplicationBuilder(ConsumerApplication.class).web(true).run(args);
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println(echoService.say("wolfking"));
	}
}
